using UnityEngine;

public class whencollected : MonoBehaviour
{
	private static int objectsNeedToBeDestroyed;

	private static int objectsDestroyed;

	private void Start()
	{
		objectsNeedToBeDestroyed++;
	}

	private void OnDestroy()
	{
		if (++objectsDestroyed == objectsNeedToBeDestroyed)
		{
			Application.LoadLevel("blank");
		}
	}
}
